package com.adui.mgt.performance.service;

import com.adui.mgt.performance.common.Result;
import com.adui.mgt.performance.entity.Subject;
import com.adui.mgt.performance.mapper.SubjectMapper;
import com.adui.mgt.performance.service.base.impl.BaseServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;

@Service
public class SubjectService extends BaseServiceImpl<SubjectMapper, Subject> {

    public Result findPage(Subject subject) {

        LambdaQueryWrapper<Subject> queryWrappers = new LambdaQueryWrapper<>(subject);
        return Result.data(this.page(new Page<>(subject.getPageNum(), subject.getPageSize()), queryWrappers));
    }
}
